<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@ include file="include/resources.jsp"%>
<script type="text/javascript" src="http://localhost:8080/MyBlog/js/articleCategoryDescrib.js"></script>
<link href="http://localhost:8080/MyBlog/css/articleCategoryDescrib.css" >
<title>articleCategoryDescrib</title>
</head>

<body>
       <div class="container">
	         <%@include file="include/header.jsp"%>
				   <div class="row" id="category_header">
					 <c:forEach items="${pageBean.data.categoryList}" var="category" >
						 	<c:if test="${!(category.id eq pageBean.data.cid)}">
			           			 <a href="${pageBean.url}&cid=${category.id}"><button type="button" class="btn btn-xs">${category.name}</button></a>&nbsp;
						 	</c:if>
						 	<c:if test="${category.id eq pageBean.data.cid}">
			           			 <a href="${pageBean.url}&cid=${category.id}"><button type="button" class="btn btn-success btn-xs" >${category.name}</button></a>&nbsp;
						 	</c:if>
					 </c:forEach>
						 	<c:if test="${pageBean.data.cid==null}">
						 	   <a href="${pageBean.url}"><button type="button" class="btn btn-success btn-xs" >显示全部</button></a>&nbsp;
						 	</c:if>
						 	<c:if test="${pageBean.data.cid!=null}">
						 	   <a href="${pageBean.url}"><button type="button" class="btn btn-xs">显示全部</button></a>&nbsp;
						 	</c:if>
				   </div>
				   
				   <c:forEach items="${pageBean.list}" var="article">
				         <div class="row">
				                <h2 style="color:red">${article.title}<h2><br/>
				         </div>
				                <span class="text-success ">${article.content}</span> 
				   </c:forEach>
				   <!--显示分页按钮-->
				   <div class="row">
				          <a href="${pageBean.url}&cid=${pageBean.data.cid}&curPage=${pageBean.curPage-1<1?1:pageBean.curPage-1}"><button class="btn btn-xs btn-success">上一页</button></a>&nbsp;&nbsp;&nbsp;
				          <c:forEach begin="${pageBean.startPageButton}" end="${pageBean.endPageButton }" var="temp"  >
						             <a href="${pageBean.url}&cid=${pageBean.data.cid}&curPage=${temp}">
						            <c:if test="${!(pageBean.curPage eq temp) }">
 						               <button class="btn btn-xs btn-default">${temp}</button>
						            </c:if>
						            <c:if test="${pageBean.curPage eq temp }">
						               <button class="btn btn-xs btn-danger">${temp}</button>
						            </c:if>
						             </a>&nbsp;&nbsp;&nbsp;
						  </c:forEach>
						  <a href="${pageBean.url}&cid=${pageBean.data.cid}&curPage=${pageBean.curPage+1>pageBean.pageNumber?pageBean.pageNumber:pageBean.curPage+1}"><button class="btn btn-xs btn-success">下一页</button></a>
				   </div>
	   </div>
	   
	   
	   
	   
	   
	   
</body>
</html>